﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IHistoryRepository.cs" company="emrecoskun.net">
//   ecblog.codeplex.com - emrecoskun.net
// </copyright>
// <summary>
//   History Repository
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace EcBlog.Data.Base
{
    using System;
    using System.Linq;

    using EcBlog.Models;

    /// <summary>
    /// History Repository
    /// </summary>
    /// <typeparam name="TEntity">The type of the entity.</typeparam>
    public interface IHistoryRepository<TEntity> where TEntity : class
    {
        /// <summary>
        /// Gets the entity list specified include properties.
        /// </summary>
        /// <param name="includeProperties">The include properties.</param>
        /// <returns>The history list query</returns>
        IQueryable<TEntity> Get(string includeProperties = "");

        /// <summary>
        /// Inserts the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="operation">The operation.</param>
        void Insert(Func<TEntity> entity, CrudOperation operation);
        
        /// <summary>
        /// Gets the entity list via raw SQL.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>The history list query</returns>
        IQueryable<TEntity> GetWithRawSql(string query, params object[] parameters);
    }
}